<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2025/6/4
  Time: 21:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>校园代取平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link type="text/css" rel="stylesheet" href="css/base.css">
    <link type="text/css" rel="stylesheet" href="css/common.css">
    <link type="text/css" rel="stylesheet" href="css/index.css">
    <script type="text/javascript" src="js/index.js" defer></script>
</head>
<body>

<%--  header --%>
<jsp:include page="header.jsp">
    <jsp:param name="flag" value="1"/>
</jsp:include>


<%--轮播图区域--%>
<div class="carousel">
    <div class="carouselImgBox">
        <img src="./picture/carousel1.jpg" class="carouselImg">
        <img src="./picture/carousel2.jpg" class="carouselImg">
        <img src="./picture/carousel3.jpg" class="carouselImg">
        <img src="./picture/carousel4.jpg" class="carouselImg">
    </div>
    <%--  控制滑动图片的按键--%>
    <div class="controls">
        <button class="last">〈 </button>
        <button class="next"> 〉</button>
    </div>
</div>

<%--  商品展示界面--%>
<div class="goods-card-list container index-goods-card-list">
    <c:forEach items="${goodsList}" var="g">
        <a href="/goods_detail?productId=${g.id}" class="index-goods-card-a">
            <div class="goods-card index-goods-card">
                <div class="card-img">
                    <img alt="商品取件码" src="${g.cover}">
                </div>
                <div class="card-information">
                    <h3 class="goods-title">${g.name}</h3>
                    <span class="goods-price">￥${g.price}</span>
                    <span class="goods-is-bargain">
            <c:choose>
                <c:when test="${g.is_bargain=='true'}">支持砍价</c:when>
                <c:otherwise>不支持砍价</c:otherwise>
            </c:choose>
          </span>
                </div>
            </div>
        </a>
    </c:forEach>
</div>
<%--footer--%>
<jsp:include page="footer.jsp"></jsp:include>

</body>
</html>
